﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Local.LMQ
{
    /// <summary>
    /// 本地消息队列中心配置类
    /// </summary>
    [Serializable]
    public class LMQConfig
    {
        /// <summary>
        /// 主题
        /// </summary>
        public string Topic { get; set; }

        /// <summary>
        /// 发布数据时是否同步发布[true:同步发布;false:异步发布]
        /// </summary>
        public bool SyncPublish { get; set; } = true;

        /// <summary>
        /// 多线程并行发布[true:多线程并行发布;false:单线程循环发布]
        /// </summary>
        public bool ParallelPublish { get; set; } = false;



        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="topic">主题</param>
        public LMQConfig(string topic)
        {
            if (string.IsNullOrEmpty(topic))
            {
                throw new ArgumentNullException(nameof(topic));
            }

            this.Topic = topic;
        }
    }
}
